<html>
<head>
<script src="/js/telepath.js"></script>
<script language=javascript>

function say () {

	var msg = document.getElementById("board").value;

	// write to stream
	TELEPATH.publish("/whiteboard", msg);
}

function recv (text) {

	document.getElementById("board").value = text;
}

function onload() {

	// create if not exist
	TELEPATH.publish("/whiteboard", "");
	
	// listen to stream
	TELEPATH.subscribe("/whiteboard", 0, recv);

	document.getElementById("board").onkeyup = say;
}

</script>
<body onload="onload();">
<textarea cols=40 rows=10 id=board>
</textarea>
</body>
</head>
</html>
